package com.smart.campus.school.service.impl;

import java.util.List;

import com.smart.campus.framework.web.domain.server.Sys;
import com.smart.campus.school.domain.Grade;
import com.smart.campus.school.domain.vo.BaseClockInQuery;
import com.smart.campus.school.domain.vo.ClockInReportVo;
import com.smart.campus.school.mapper.GradeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.campus.school.mapper.ClockInRecordMapper;
import com.smart.campus.school.domain.ClockInRecord;
import com.smart.campus.school.service.IClockInRecordService;
import com.smart.campus.common.core.text.Convert;

/**
 * 考勤记录Service业务层处理
 * 
 * @author Zhihe.Li
 * @date 2020-05-29
 */
@Service
public class ClockInRecordServiceImpl implements IClockInRecordService 
{
    @Autowired
    private ClockInRecordMapper clockInRecordMapper;
    @Autowired
    private GradeMapper gradeMapper;

    /**
     * 查询考勤记录
     * 
     * @param id 考勤记录ID
     * @return 考勤记录
     */
    @Override
    public ClockInRecord selectClockInRecordById(Long id)
    {
        return clockInRecordMapper.selectClockInRecordById(id);
    }

    /**
     * 查询考勤记录列表
     * 
     * @param clockInRecord 考勤记录
     * @return 考勤记录
     */
    @Override
    public List<ClockInRecord> selectClockInRecordList(ClockInRecord clockInRecord)
    {
        return clockInRecordMapper.selectClockInRecordList(clockInRecord);
    }

    /**
     * 新增考勤记录
     * 
     * @param clockInRecord 考勤记录
     * @return 结果
     */
    @Override
    public int insertClockInRecord(ClockInRecord clockInRecord)
    {

        clockInRecord.setId(System.currentTimeMillis());
        return clockInRecordMapper.insertClockInRecord(clockInRecord);
    }

    /**
     * 修改考勤记录
     * 
     * @param clockInRecord 考勤记录
     * @return 结果
     */
    @Override
    public int updateClockInRecord(ClockInRecord clockInRecord)
    {
        return clockInRecordMapper.updateClockInRecord(clockInRecord);
    }

    /**
     * 删除考勤记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteClockInRecordByIds(String ids)
    {
        return clockInRecordMapper.deleteClockInRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除考勤记录信息
     * 
     * @param id 考勤记录ID
     * @return 结果
     */
    @Override
    public int deleteClockInRecordById(Long id)
    {
        return clockInRecordMapper.deleteClockInRecordById(id);
    }

    @Override
    public List<ClockInReportVo> queryClockInDataGrade(BaseClockInQuery query) {


        return  clockInRecordMapper.queryClockInDataGrade(query);
    }

    @Override
    public List<ClockInReportVo> queryClockInDataClazz(BaseClockInQuery query) {
        return  clockInRecordMapper.queryClockInDataClazz(query);
    }

    @Override
    public List<ClockInReportVo> queryClockInDataStudent(BaseClockInQuery query) {
        return clockInRecordMapper.queryClockInDataStudentId(query);
    }

    @Override
    public int deleteClockInRecordByObj(ClockInRecord clockInRecord) {
        return clockInRecordMapper.deleteClockInRecordByObj(clockInRecord);
    }
}
